<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            display: inline-block;
            height: 200px;
            border-color: pink;
            padding: 10px;
            border: 20px solid red;
        }
    </style>
</head>
<body>
   <div>1233445i5505656</div> 
   <script>
    const div = document.querySelector('div')
    window.addEventListener('resize',function(){
        console.log(document.documentElement.clientWidth);
        
    } )
   </script>
</body>
</html>